const BASE_URL = "http://localhost:8000";

export const get = (url: string) => {
  return fetch(BASE_URL + url)
    .then((response) => response.json())
    .then((data) => {
      return data;
    });
};

export const post = (url: string, body: object) => {
  return fetch(BASE_URL + url, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(body),
  })
    .then((response) => response.json())
    .then((data) => {
      return data;
    });
};
